﻿using System;
using System.Collections.Generic;
using System.Text;

using Model;

namespace BLL
{
    public class SystemBLL
    {
        private readonly Isystem isystem;
        public SystemBLL(Isystem isy)
        {
            this.isystem = isy;
        }
        //人员显示
        public IEnumerable<Personnel> personnels()
        {
            return isystem.personnels();
        }
        //部门下拉框显示
        public IEnumerable<Department> Department()
        {
            return isystem.Departments();
        }
        //职位下拉框显示
        public IEnumerable<Position> positions()
        {
            return isystem.positions();
        }
        //状态下拉框显示
        public IEnumerable<Tstate> SelStates()
        {
            return isystem.SelStates();
        }
        //人员管理删除
        public int Delete(int id)
        {
            return isystem.Delete(id);
        }
        //人员添加
        public int Add(Personnel p)
        {
            return isystem.Add(p);
        }
        //角色管理
        public IEnumerable<Role> Roles()
        {
            return isystem.Roles();
        }
        //角色添加
        public int AddRole(Role r)
        {
            return isystem.AddRole(r);
        }
        //角色管理删除
        public int DelRole(int id)
        {
            return isystem.DelRoles(id);
        }

        //角色修改
        public int UpdateRole(Role r)
        {
            return isystem.UpdateRole(r);
        }

        //职位管理
        public IEnumerable<Position> SelPositions()
        {
            return isystem.SelPositions();
        }
        //职位管理添加
        public int AddPosition(Position p)
        {
            return isystem.AddPosition(p);
        }
        //职位删除
        public int DelPosition(int id)
        {
            return isystem.DelPosition(id);
        }
        //职位修改
        public int Update(Position p)
        {
            return isystem.Update(p);
        }
        //部门管理
        public IEnumerable<Department> SelDepartment()
        {
            return isystem.SelDepartments();
        }
        //部门删除
        public int DelDepartment(int id)
        {
            return isystem.DelDepartments(id);
        }
        //部门管理添加
        public int AddDepartments(Department d)
        {
            return isystem.AddDepartments(d);
        }
        //部门修改
        public int UpdateDepartment(Department d)
        {
            return isystem.UpdateDepartment(d);
        }
        public IEnumerable<Personnel> Login(string user,string pwd)
        {
            return isystem.Login(user,pwd);
        }
        public IEnumerable<Personnel> Personnel()
        {
            return isystem.personnel();
        }
        public IEnumerable<Rights> Right(int id)
        {
            return isystem.Right(id);
        }
        public IEnumerable<Role> Roless()
        {
            return isystem.Roles();
        }
        public int upersonnel(int pid, int id) 
        {
            return isystem.upersonnel(pid,id);
        }
        public int Updatep(Personnel p)
        {
            return isystem.Updatep(p);
        }
    }
}
